﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace AfterCaveStory
{
    class World
    {
        public float gravidade;

        public List<PhysicsObject> objectList = new List<PhysicsObject>();


        public World(float gravidade)
        {
            this.gravidade = gravidade;
        }

        public void createObject(PhysicsObject newObject)
        {
            objectList.Add(newObject);
        }

        public void update()
        {
            for (int i = 0; i < objectList.Count; i++)
            {
                objectList[i].update(this);
            }
        }

        public void draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            for (int i = 0; i < objectList.Count; i++)
            {
                objectList[i].draw(gameTime, spriteBatch);
            }
        }

    }
}
